// 页面路径：store/index.js
import Vue from "vue";
import Vuex from "vuex";
// 引入uniapp的 vuex 持久化插件
import persistence from "vuex-uniapp-persistence";

// 引入模块
import user from "./user"

Vue.use(Vuex); //vue的插件机制
//Vuex.Store 构造器选项
const store = new Vuex.Store({
  state: {
    // 获取安全区域
    safeArea: uni.getSystemInfoSync().safeArea,
    bounding: uni.getMenuButtonBoundingClientRect(), // 获取胶囊信息
  },
  getters: {},
  mutations:{
    
  },
  modules: { user },
  // 使用模块 vuex持久化 语法：plugins: [persistence("key")]
  plugins: [persistence("date")], // date 本地存储中的key
});
export default store;
